/*
 * Copyright (C) 2010,2011.
 * AHCP Project
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 *
 *     http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.jacp.demo.ui;

import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.util.Map;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.jacp.api.action.IAction;
import org.jacp.api.componentLayout.Layout;
import org.jacp.demo.util.PanelDropTarget;
import org.jacp.swing.rcp.component.ASwingComponent;

/**
 * defines bottom part of UI; container to collect all Images
 * 
 * @author Patrick Symmangk
 * 
 */
public class OrderEditor extends ASwingComponent {

	private JPanel panel;

	@Override
	public void handleBarEntries(final Map<Layout, Container> arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void handleMenuEntries(final Container arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public Container handleAction(final IAction<ActionEvent, Object> action) {
		if (panel == null) {
			panel = new JPanel();
			final PanelDropTarget t = new PanelDropTarget(panel);
			panel.setBorder(BorderFactory.createLineBorder(new Color(0xd6dde5),
					0));
			// panel.setBackground(Color.red);
			final JLabel label = new JLabel("ORDER");
			panel.add(label);
		}
		return panel;
	}

}
